Skip to content

fix: throttle analytics prompt to monthly#51

Merged
BP602 merged 2 commits intomainfrom
codex/add-dismissible-message-for-analytics
Oct 2, 2025
Merged

fix: throttle analytics prompt to monthly#51
BP602 merged 2 commits intomainfrom
codex/add-dismissible-message-for-analytics

Conversation

@BP602
Copy link
Owner

@BP602 BP602 commented Oct 2, 2025

Summary

  • add a dismissible analytics prompt alongside the chat info bar
  • allow enabling telemetry directly from the chat prompt and persist dismissal state with a 30-day cooldown
  • style the new analytics banner to match existing chat input treatments

Testing

  • npm run lint

https://chatgpt.com/codex/tasks/task_e_68dd7eb25ae4833185a25f5bde706947

Summary by CodeRabbit

  • New Features

    • Added an in-app prompt below the chat input to enable analytics, with “Enable Analytics” and “Dismiss” actions; user choice is remembered.
  • Improvements

    • Polished styling, hover/focus states, and a slide-and-fade entrance for the prompt; consistent visibility across chats and sessions, respecting prior choices and settings.
  • Performance

    • Minor render optimizations to reduce unnecessary re-renders and improve chat input responsiveness.

@coderabbitai
Copy link

coderabbitai bot commented Oct 2, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a telemetry prompt UI and logic to ChatInput with persistence (localStorage + TTL and legacy migration), updates rendering/memoization to consider telemetry state, and wraps ReplyThread rendering with SettingsProvider while passing settings into ChatInput.

Changes

Cohort / File(s) Summary
Telemetry prompt UI styling
src/renderer/src/assets/styles/components/Chat/Input.scss
Adds .chatTelemetryPrompt and nested elements (.chatTelemetryPromptDismiss, .chatTelemetryPromptContent, .chatTelemetryPromptText, .chatTelemetryPromptActions, .chatTelemetryPromptEnable) with layout, hover/focus states, borders/background, and slideAndFadeIn animation scoped under .chatInfoBar.
Telemetry prompt logic and rendering
src/renderer/src/components/Chat/Input/index.jsx
Introduces TELEMETRY_PROMPT_DISMISSED_KEY and TTL, persistence and legacy migration helpers in localStorage, showTelemetryPrompt state with mount/effect logic driven by settings and stored dismissal, handlers to enable telemetry or dismiss (persisting dismissal and updating settings), conditional rendering of the prompt, and updates memo comparison to include settings?.telemetry?.enabled.
SettingsProvider integration for ReplyThread
src/renderer/src/components/Dialogs/ReplyThread.jsx, src/renderer/src/dialogs/ReplyThread.jsx
ReplyThread usage now passes settings={dialogData?.settings} into ChatInput; top-level dialog render is wrapped with <SettingsProvider> in the dialog entrypoint. No other control-flow changes.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant CI as ChatInput
  participant SP as SettingsProvider
  participant LS as localStorage

  Note over CI: On mount
  CI->>LS: Read dismissal record (migrate legacy if needed)
  CI->>SP: Read settings.telemetry.enabled
  alt telemetry disabled AND no valid dismissal
    CI->>CI: showTelemetryPrompt = true
  else
    CI->>CI: showTelemetryPrompt = false
  end

  U->>CI: Click "Enable Analytics"
  CI->>SP: Update settings.telemetry.enabled = true
  CI->>LS: Persist dismissal with TTL
  CI->>CI: Hide prompt

  U->>CI: Click "Dismiss"
  CI->>LS: Persist dismissal with TTL
  CI->>CI: Hide prompt
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

A whisker-twitch, a gentle nudge—
I log my hops (with your warm judge).
Enable? Dismiss? I’ll mind your say,
And stash the choice to guide my way.
In burrows deep of local lore,
Your settings echo: hop once more! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit's high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures a key aspect of the changeset by indicating that the analytics prompt is now throttled to a monthly interval, and it remains concise and clear without extraneous detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/add-dismissible-message-for-analytics

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f27527a and f94b9ff.

📒 Files selected for processing (4)
  • src/renderer/src/assets/styles/components/Chat/Input.scss (1 hunks)
  • src/renderer/src/components/Chat/Input/index.jsx (6 hunks)
  • src/renderer/src/components/Dialogs/ReplyThread.jsx (1 hunks)
  • src/renderer/src/dialogs/ReplyThread.jsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**

📄 CodeRabbit inference engine (AGENTS.md)

**: Use electron-vite + React conventions instead of raw Electron patterns
When unsure, consult electron-vite/Electron/Vite docs (Context7) to confirm patterns
Omit empty sections in release notes

Files:

  • src/renderer/src/components/Dialogs/ReplyThread.jsx
  • src/renderer/src/assets/styles/components/Chat/Input.scss
  • src/renderer/src/components/Chat/Input/index.jsx
  • src/renderer/src/dialogs/ReplyThread.jsx
src/renderer/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/renderer/src/**/*.{ts,tsx,js,jsx}: Do not use direct Node APIs in the renderer
Use ipcRenderer.invoke('channel', payload) for request/response from renderer
Use import.meta.env.RENDERER_VITE_* for renderer-scoped config
Avoid bare KT_* env vars in the renderer; use RENDERER_VITE_KT_* instead

Files:

  • src/renderer/src/components/Dialogs/ReplyThread.jsx
  • src/renderer/src/components/Chat/Input/index.jsx
  • src/renderer/src/dialogs/ReplyThread.jsx
src/{renderer/src,preload}/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Resolve static assets via Vite URLs (new URL('./asset', import.meta.url))

Files:

  • src/renderer/src/components/Dialogs/ReplyThread.jsx
  • src/renderer/src/components/Chat/Input/index.jsx
  • src/renderer/src/dialogs/ReplyThread.jsx
src/{main,renderer/src}/**/*.{ts,tsx,js,jsx,mts,mjs,cjs}

📄 CodeRabbit inference engine (AGENTS.md)

For fire-and-forget events, use ipcRenderer.send and ipcMain.on with namespaced channels like 'app:settings:get'

Files:

  • src/renderer/src/components/Dialogs/ReplyThread.jsx
  • src/renderer/src/components/Chat/Input/index.jsx
  • src/renderer/src/dialogs/ReplyThread.jsx
src/{main,preload,renderer/src}/**/*.{ts,tsx,js,jsx,mts,mjs,cjs}

📄 CodeRabbit inference engine (AGENTS.md)

Use shared non-secret variables via import.meta.env.VITE_*

Files:

  • src/renderer/src/components/Dialogs/ReplyThread.jsx
  • src/renderer/src/components/Chat/Input/index.jsx
  • src/renderer/src/dialogs/ReplyThread.jsx
!dist/**

📄 CodeRabbit inference engine (AGENTS.md)

Do not commit built installers/artifacts in dist/

Files:

  • src/renderer/src/components/Dialogs/ReplyThread.jsx
  • src/renderer/src/assets/styles/components/Chat/Input.scss
  • src/renderer/src/components/Chat/Input/index.jsx
  • src/renderer/src/dialogs/ReplyThread.jsx
🧬 Code graph analysis (3)
src/renderer/src/components/Dialogs/ReplyThread.jsx (1)
src/renderer/src/components/Chat/Input/index.jsx (1)
  • ChatInput (1227-1526)
src/renderer/src/components/Chat/Input/index.jsx (4)
src/renderer/src/pages/ChatPage.jsx (1)
  • useSettings (78-78)
src/renderer/src/components/Dialogs/Settings.jsx (1)
  • useSettings (17-17)
src/renderer/src/components/Dialogs/Settings/index.jsx (1)
  • useSettings (14-14)
src/renderer/src/providers/SettingsProvider.jsx (3)
  • useSettings (86-92)
  • useSettings (86-92)
  • settings (8-8)
src/renderer/src/dialogs/ReplyThread.jsx (2)
src/renderer/src/providers/SettingsProvider.jsx (1)
  • SettingsProvider (7-84)
src/renderer/src/components/Dialogs/ReplyThread.jsx (1)
  • ReplyThread (8-121)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: test-builds (macos-latest)
  • GitHub Check: test-builds (ubuntu-latest)
  • GitHub Check: test-builds (windows-latest)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

@BP602 BP602 merged commit 3a00dae into main Oct 2, 2025
6 checks passed
@BP602 BP602 deleted the codex/add-dismissible-message-for-analytics branch October 2, 2025 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant